package com.lanyou.esb.cook.proxy.entity;

import java.net.URI;
import java.util.Date;

import javax.xml.bind.annotation.XmlElement;

import org.apache.commons.lang3.StringUtils;

import com.lanyou.esb.cook.proxy.common.Constants;

/**
 * 领域系统表
 * 
 * @author Davey.wu
 */
public class FieldSystem {
	/** 领域系统表ID **/
	private String id;

	/** 领域信息表ID **/
	private String fieldId;

	/** 系统编码 **/
	private String code;

	/** 系统名称 **/
	private String name;

	/** 备注 **/
	private String remark;

	/** KETTLE目录表主键 **/
	private int directoryId;

	/** 是否可用 **/
	private boolean isEnable;

	/** 创建人 **/
	private String creator;

	/** 创建时间 **/
	private Date createdDate;

	/** 最后更新人员 **/
	private String modifier;

	/** 最后更新时间 **/
	private Date lastUpdatedDate;

	/** 并发控制字段 **/
	private int version;

	/** 是否输出日志 **/
	private boolean logging = true;

	/** 是否直接指向IP **/
	private boolean forwardIP = true;

	/** 用户代理是否支持发送url片断,即"#" */
	private boolean sendUrlFragment = true;
	private URI targetUriObj;

	@XmlElement
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isLogging() {
		return logging;
	}

	public void setLogging(boolean logging) {
		this.logging = logging;
	}

	public boolean isForwardIP() {
		return forwardIP;
	}

	public void setForwardIP(boolean forwardIP) {
		this.forwardIP = forwardIP;
	}

	public boolean isSendUrlFragment() {
		return sendUrlFragment;
	}

	public void setSendUrlFragment(boolean sendUrlFragment) {
		this.sendUrlFragment = sendUrlFragment;
	}

	public URI getTargetUriObj() {
		return targetUriObj;
	}

	public void setTargetUriObj(URI targetUriObj) {
		this.targetUriObj = targetUriObj;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFieldId() {
		return fieldId;
	}

	public void setFieldId(String fieldId) {
		this.fieldId = fieldId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public int getDirectoryId() {
		return directoryId;
	}

	public void setDirectoryId(int directoryId) {
		this.directoryId = directoryId;
	}

	public boolean isEnable() {
		return isEnable;
	}

	public void setEnable(boolean isEnable) {
		this.isEnable = isEnable;
	}

	public String getCreator() {
		return StringUtils.isEmpty(creator) ? Constants.DEFAULT_USER : creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public Date getCreatedDate() {
		return createdDate == null ? new Date() : createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getModifier() {
		return StringUtils.isEmpty(modifier) ? Constants.DEFAULT_USER
				: modifier;
	}

	public void setModifier(String modifier) {
		this.modifier = modifier;
	}

	public Date getLastUpdatedDate() {
		return lastUpdatedDate;
	}

	public void setLastUpdatedDate(Date lastUpdatedDate) {
		this.lastUpdatedDate = lastUpdatedDate;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

}
